package ch7oopexer1;
/*抽象出父类 飞机(起飞,加速和降落方法)，
以及客机和战斗机两个子类.战斗机添加额外的方法,比如发射导弹.*/
public class Plane {
    private double weight;
    private double height;

    public Plane() {
    }

    public Plane(double weight, double height) {
        this.weight = weight;
        this.height = height;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public void run(Plane plane){
        System.out.println("飞机起飞");
    }
    public void land(Plane plane){
        System.out.println("飞机降落");
    }

    public void show(){
        System.out.println("飞机飞行高度："+height+" , 飞机自重："+weight);
    }
}
